﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class UILogicBehaviour : LuaBehaviour
{
    private Action m_LuaOpen;
    private Action m_LuaClose;

    public override void Init(string luaName)
    {
        base.Init(luaName);
        m_ScriptEnv.Get("OnUIClose",out m_LuaClose);
        m_ScriptEnv.Get("OnUIOpen", out m_LuaOpen);
    }

    public void OnUIClose()
    {
        m_LuaClose?.Invoke();
    }

    public void OnUIOpen()
    {
        m_LuaOpen?.Invoke();
    }

    protected override void LuaClear()
    {
        base.LuaClear();
        m_LuaClose = null;
        m_LuaOpen = null;
    }
}
